﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;

namespace Role.Entity
{
    /// <summary>
    /// WorkFlow_Info数据有效性验证
    /// </summary>
    public class WorkFlow_Info_Meta
    {
        public int ID { get; set; }
        public Nullable<int> PrevNode { get; set; }
        public Nullable<int> NextNode { get; set; }
        [Required(ErrorMessage = "请填写工作流名称")]
        [Display(Name = "工作流名称")]
        public string Name { get; set; }
        public string Info { get; set; }
    }
    /// <summary>
    /// 工作流实体
    /// </summary>
    [MetadataType(typeof(WorkFlow_Info_Meta))]
    public partial class WorkFlow_Info
    {
        #region 导航属性
        /// <summary>
        /// 是否为首结点
        /// </summary>
        public bool IsFirstNode
        {
            get
            {
                return this.PrevNode == null;
            }
        }
        /// <summary>
        /// 是否为尾结点
        /// </summary>
        public bool IsEndNode
        {
            get
            {
                return this.NextNode == null;
            }
        }
        /// <summary>
        /// 前驱节点
        /// </summary>
        public WorkFlow_Info PrevNodeEntity { get; set; }
        /// <summary>
        /// 后继节点
        /// </summary>
        public WorkFlow_Info NextNodeEntity { get; set; }

        public WorkFlow WorkFlow { get; set; }
        #endregion
    }
    /// <summary>
    /// 工作量实体扩展
    /// </summary>
    public class WorkFlow_Info_Ext : WorkFlow_Info
    {
    }
}
